package co.yixiang.yshop.module.crm.dal.mysql.crmworkwxuser;

import java.util.*;

import co.yixiang.yshop.framework.common.pojo.PageResult;
import co.yixiang.yshop.framework.mybatis.core.query.LambdaQueryWrapperX;
import co.yixiang.yshop.framework.mybatis.core.mapper.BaseMapperX;
import co.yixiang.yshop.module.crm.dal.dataobject.crmworkwxuser.CrmWorkWxUserDO;
import org.apache.ibatis.annotations.Mapper;
import co.yixiang.yshop.module.crm.controller.admin.crmworkwxuser.vo.*;

/**
 * 企业微信员工 Mapper
 *
 * @author yshop
 */
@Mapper
public interface CrmWorkWxUserMapper extends BaseMapperX<CrmWorkWxUserDO> {

    default PageResult<CrmWorkWxUserDO> selectPage(CrmWorkWxUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CrmWorkWxUserDO>()
                .eqIfPresent(CrmWorkWxUserDO::getAdminId, reqVO.getAdminId())
                .eqIfPresent(CrmWorkWxUserDO::getCorpId, reqVO.getCorpId())
                .eqIfPresent(CrmWorkWxUserDO::getUserid, reqVO.getUserid())
                .likeIfPresent(CrmWorkWxUserDO::getName, reqVO.getName())
                .eqIfPresent(CrmWorkWxUserDO::getMobile, reqVO.getMobile())
                .eqIfPresent(CrmWorkWxUserDO::getEmail, reqVO.getEmail())
                .eqIfPresent(CrmWorkWxUserDO::getAvatar, reqVO.getAvatar())
                .eqIfPresent(CrmWorkWxUserDO::getGender, reqVO.getGender())
                .eqIfPresent(CrmWorkWxUserDO::getPosition, reqVO.getPosition())
                .eqIfPresent(CrmWorkWxUserDO::getQrCode, reqVO.getQrCode())
                .eqIfPresent(CrmWorkWxUserDO::getStatus, reqVO.getStatus())
                .eqIfPresent(CrmWorkWxUserDO::getWeigh, reqVO.getWeigh())
                .betweenIfPresent(CrmWorkWxUserDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CrmWorkWxUserDO::getId));
    }

}